Previous Book Contents Book Index Next

Inside Macintosh: AppleScript Language Guide / Part 3 - Appendixes
Appendix B - Scriptable Text Editor Dictionary / Scriptable Text Editor Commands


Cut

The Cut command is a request to remove an object and put it on the Clipboard. If the Cut command includes a direct parameter, it removes the object specified in the direct parameter. If the command does not include a direct parameter, it removes the object in the current selection.

The Cut command has the same result as choosing the Cut menu item in the Scriptable Text Editor: the object that was cut replaces any objects that were previously on the Clipboard.

SYNTAX
cut [ referenceToObject ] 
PARAMETER
referenceToObject
A reference to the object to be cut.
Class: Reference
RESULT
None

EXAMPLE
Both of the following statements cut the first paragraph of a document.

tell application "Scriptable Text Editor"   set the selection to paragraph 1 of document "Test" 
   cut
end tell
tell application "Scriptable Text Editor"   cut paragraph 1 of document "Test" 
end tell
NOTES
If you do not specify a direct parameter and there is no selection to be cut, the Scriptable Text Editor does not change the contents of the Clipboard.

If you specify a direct parameter, it must be a reference to a single object. The Scriptable Text Editor cannot cut ranges of objects. For example, the following statement results in an error.

tell application "Scriptable Text Editor"   cut words of paragraph 5 of front document
end tell
--result: error, because Cut can handle single objects only

Previous Book Contents Book Index Next

© Apple Computer, Inc.
13 JUL 1996